package top.maochang.hou.tools;


import java.io.Serializable;

public class Result<T> implements Serializable {

    //操作的结果编码
    private Integer code;
    //消息
    private String msg;
    //数量
    private Integer count;
    //操作数据结果
    private T data;
    //是否成功
    private  boolean success;


    public Result(Integer code) {
        this.code = code;
    }
    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public Result(Integer code, String msg,T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;

    }
    public Result(int code, String msg, T data,Integer count) {
        this.data = data;
        this.code = code;
        this.msg = msg;
        this.count=count;
    }

    public Result(int code, String msg, T data, Integer count,boolean success) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.count=count;
        this.success = success;
    }




    

    public Result() {
    }



    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return msg;
    }

    public void setMessage(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }



    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", count='" + count + '\'' +
                ", data=" + data +
                '}';
    }

}
